package com.wish.group05.house.controller;

import java.util.List;

import com.wish.group05.base.dto.RoomInfoDTO;
import com.wish.group05.base.vo.RoomInfoVO;
import com.wish.group05.common.core.web.controller.BaseController;
import com.wish.group05.common.core.web.domain.AjaxResult;
import com.wish.group05.common.core.web.page.TableDataInfo;
import com.wish.group05.common.security.annotation.PreAuthorize;
import com.wish.group05.house.service.ITbRoomInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 【请填写功能名称】Controller
 *
 * @author xuekai
 * @date 2022-05-30
 */
@RestController
@RequestMapping("/fangtai")
public class TbFangTaiController extends BaseController
{
    @Autowired
    private ITbRoomInfoService roomInfoService;


    /**
     * 是否推荐房源处理
     * @param roomInfoDTO
     * @return
     */
    @PutMapping("/editRecommended")
    public AjaxResult edit(@RequestBody RoomInfoDTO roomInfoDTO)
    {
        return roomInfoService.editRecommended(roomInfoDTO);
    }

    /**
     * 房态图
     */
    @PutMapping("/roomAvailabilityFigure")
    public TableDataInfo roomAvailabilityFigure(@RequestBody RoomInfoDTO roomInfoDTO){
        startPage();
        return roomInfoService.roomAvailabilityFigure(roomInfoDTO);
    }

    /**
     * 修改发布状态
     * @param roomInfoDTO
     * @return
     */
    @PutMapping("/updatePublishStatus")
    public AjaxResult updatePublishStatus(@RequestBody RoomInfoDTO roomInfoDTO){
        return roomInfoService.updatePublishStatus(roomInfoDTO);
    }



    /*  *//**
 * 导出【请填写功能名称】列表
 *//*
    @PreAuthorize(hasPermi = "system:info:export")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TbRoomInfo tbRoomInfo) throws IOException
    {
        List<TbRoomInfo> list = tbRoomInfoService.selectTbRoomInfoList(tbRoomInfo);
        ExcelUtil<TbRoomInfo> util = new ExcelUtil<TbRoomInfo>(TbRoomInfo.class);
        util.exportExcel(response, list, "info");
    }

    *//**
 * 获取【请填写功能名称】详细信息
 *//*
    @PreAuthorize(hasPermi = "system:info:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return AjaxResult.success(tbRoomInfoService.selectTbRoomInfoById(id));
    }

    *//**
 * 新增【请填写功能名称】
 *//*
    @PreAuthorize(hasPermi = "system:info:add")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TbRoomInfo tbRoomInfo)
    {
        return toAjax(tbRoomInfoService.insertTbRoomInfo(tbRoomInfo));
    }



    *//**
 * 删除【请填写功能名称】
 *//*
    @PreAuthorize(hasPermi = "system:info:remove")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(tbRoomInfoService.deleteTbRoomInfoByIds(ids));
    }*/
}
